<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>模型管理</title>
    <link rel="stylesheet" href="/activiti/ui/plugins/layui/css/layui.css" media="all">
</head>
<body>
<div>
    <input id="proInstId" type="hidden"/>
    <div class="viewFileDiv"></div>
</div>
<script src="/activiti/ui/plugins/layui/layui.js"></script>

<script>

    layui.config({
        base: '/activiti/ui/src/js/modules/' //假设这是你存放拓展模块的根目录
    }).extend({ //设定模块别名
        myutil: 'common' //如果 mymod.js 是在根目录，也可以不用设定别名
    });

    layui.use(['table', 'jquery', 'laydate'], function () {
        var table = layui.table;
        var $ = layui.jquery;
        var laydata = layui.laydate;
        $.ajax({
            type: "POST",
            url: '/activiti/service/viewFile',
            dataType: "xml",
            data: {
                processDefinitionId: $("#proInstId").val()
            },
            success: function (data) {
                console.info("=============" + data);
                var str="<xmp>"+data.documentElement.innerHTML+"</xmp>"
                document.write(str);
                // document.getElementsByClassName("viewFileDiv")[0].innerText = data.documentElement.innerHTML;
            }
        });
    });

    Date.prototype.Format = function (fmt) { //author: meizz
        var o = {
            "M+": this.getMonth() + 1,                 //月份
            "d+": this.getDate(),                    //日
            "h+": this.getHours(),                   //小时
            "m+": this.getMinutes(),                 //分
            "s+": this.getSeconds(),                 //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds()             //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }

</script>
<script type="text/html" id="createTime">

    {{#
    var date = new Date();
    date.setTime(d.creTime);
    return date.Format("yyyy-MM-dd hh:mm:ss");
    }}

</script>
</body>
</html>